import request from '@/utils/request'

interface IUserInfoSuccess{
    status: number,
    userInfo: IUserInfo,
    roles: IRole[],
}
// 登录
export const login = (account: ILoginAccount) => request<any, ILoginSuccess>({
    url:'/api/v1/admin/sessions',
    method: 'POST',
    data: account, 
})

// 获取用户登录信息
export const getInfo = () => request<any, IUserInfoSuccess>({
    url:'api/v1/admin/sessions/userinfo',
    method: 'GET'
})